package com.somsoft.handjc.activity.jiancha.xzzf;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONArray;
import org.json.JSONObject;

import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;
import android.widget.Toast;

import com.somsoft.handjc.activity.R;
import com.somsoft.handjc.util.BaseActivity;
import com.somsoft.handjc.util.MyApplication;
import com.somsoft.handjc.util.XzzfDataUtil;

/**
 * 案件信息查询
 * 
 * 
 */
@SuppressWarnings("all")
public class XzzfJcDetailActivity extends BaseActivity {

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		MyApplication.getInstance().addActivity(this);
		setTitle("案件监察信息明细");
		setContentView(R.layout.xzzf_zhonghe_query_detail);
		try {
			Intent it = getIntent();
			String caseId = it.getStringExtra("caseId");
			String jcType = it.getStringExtra("jcType");
			getData(caseId,jcType);
		} catch (Exception e) {
			Toast.makeText(XzzfJcDetailActivity.this, "加载数据失败！", Toast.LENGTH_SHORT).show();
		}
		
	}
	
	private List<Map<String, Object>> getData(String caseId,String jcType) throws Exception{
		List<NameValuePair> params = new ArrayList<NameValuePair>();
		params.add(new BasicNameValuePair("caseId",caseId));
		params.add(new BasicNameValuePair("jcType",jcType));
		
		List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
		try {
			JSONObject obj = XzzfDataUtil.jcDetail(params);
			Map<String, Object> map = new HashMap<String, Object>(); 
			String txt = "";
			txt += "案件编号："+obj.get("caseNo")+"\n";
			txt += "案件名称："+obj.get("caseName")+"\n";
			txt += "所属部门："+obj.get("deptName")+"\n";
			txt += "受理人："+obj.get("shouliUsers")+"\n";
			txt += "受理时间："+obj.get("shouliDate")+"\n";
			txt += "来源方式："+obj.get("sourceMode")+"\n";
			txt += "案发地址："+obj.get("caseAddr")+"\n";
			txt += "当事人："+obj.get("breakers")+"\n";
			txt += "案发时间："+obj.get("caseDate")+"\n";
			txt += "违法事实描述："+obj.get("caseDesc")+"\n";
			txt += "案件流程："+obj.get("positionInfo")+"\n\n";
			
			txt += "监督结果："+obj.get("jcresult")+"\n\n";
			txt += "监督类型："+obj.get("jcType")+"\n\n";
			txt += "监督依据："+obj.get("description")+"\n\n";
			txt += "监督标准："+obj.get("staDescription")+"\n\n";
			txt += "实际处罚金额："+obj.get("real")+"\n\n";
			
			txt += "从重从轻说明："+obj.get("lightOrWeight")+"\n\n";
			txt += "监督环节："+obj.get("positionName")+"\n\n";
			txt += "办案人员："+obj.get("shouliUsers")+"\n\n";
			txt += "办案时间："+obj.get("shouliDate")+"\n\n";
			txt += "监督时间："+obj.get("jcDate")+"\n\n";
			
			
			((TextView)findViewById(R.id.caseDetail)).setText(txt);
			list.add(map);
		} catch (Exception e) {
			throw e;
		}
		return list;

	}


}
